layui.use(['layer','jquery'],function () {
    var layer = layui.layer
        ,$ = layui.jquery;
    $('#captcha').sliderCaptcha({
        repeatIcon:'fa fa-redo',
        setSrc: function () {
            var jpg = 'http://localhost:8090/images/sliderImg/Pic'+ Math.round(Math.random()*4) +'.jpg';
            return jpg;
        },
        onSuccess: function () {
            parent.$('#verification').val('通过');
            parent.$('#sub').click();
        },
        onFail:function(){
            layer.msg('请重新验证');
            //parent.$('#verification').val('禁止');
        }
    });
});